package cn.jtfadmin.core.modules.sys.domain.dto;

import cn.jtfadmin.base.lang.common.domain.dto.EditPDTO;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 系统环境配置
 */
@Data
public class SysEnvDTO implements Serializable, EditPDTO {

    /**
     * 变量key
     */
    @NotBlank
    protected String key;

    /**
     * 变量值
     */
    protected String value;

    /**
     * 变量缺省值
     */
    protected String defaultValue;

    /**
     * 变量描述
     */
    protected String describe;

    /**
     * 排序
     */
    protected Integer sort;

    @Override
    public String getId() {
        return key;
    }

    @Override
    public void setId(String id) {
        this.key = id;
    }

    public SysEnvDTO() {
    }

    public SysEnvDTO(@NotBlank String key, String defaultValue, String describe, Integer sort) {
        this.key = key;
        this.defaultValue = defaultValue;
        this.describe = describe;
        this.sort = sort;
    }

    public SysEnvDTO(@NotBlank String key, String value, String defaultValue, String describe, Integer sort) {
        this.key = key;
        this.value = value;
        this.defaultValue = defaultValue;
        this.describe = describe;
        this.sort = sort;
    }
}
